package com.psct;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 缓存线程池，用来执行短期的异步任务
 * 
 * @author zjingchuan
 * 
 */
public class ThreadPool {
	static ExecutorService pool;

	public static void execute(Runnable task) {
		if (pool == null) {
			pool = Executors.newCachedThreadPool();
		}
		pool.execute(task);
	}
}
